package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PassCardRuleOperationLogMapper;
import com.ruoyi.system.domain.PassCardRuleOperationLog;
import com.ruoyi.system.service.IPassCardRuleOperationLogService;

/**
 * 商品次卡规则操作记录 Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-23
 */
@Service
public class PassCardRuleOperationLogServiceImpl implements IPassCardRuleOperationLogService
{
    @Autowired
    private PassCardRuleOperationLogMapper passCardRuleOperationLogMapper;

    /**
     * 通过id查询商品次卡规则操作记录
     *
     * @param id 商品次卡规则操作记录主键
     * @return 商品次卡规则操作记录
     */
    @Override
    public PassCardRuleOperationLog selectPassCardRuleOperationLogById(Long id)
    {
        return passCardRuleOperationLogMapper.selectPassCardRuleOperationLogById(id);
    }

    /**
     * 通过条件查询商品次卡规则操作记录列表
     *
     * @param operatedStoreName,operationType,passCardCode,operationStartTime,operationEndTime 操作门店，操作类型，桌台次卡编码，操作开始时间，操作结束时间
     * @return 商品次卡规则操作记录
     */
    @Override
    public List<PassCardRuleOperationLog> selectPassCardRuleOperationLogListByConditions(String operatedStoreName, String operationType, String passCardCode, Date operationStartTime, Date operationEndTime)
    {
        return passCardRuleOperationLogMapper.selectPassCardRuleOperationLogListByConditions(operatedStoreName,operationType,passCardCode,operationStartTime,operationEndTime);
    }

    /**
     * 新增商品次卡规则操作记录
     *
     * @param passCardRuleOperationLog 商品次卡规则操作记录
     * @return 结果
     */
    @Override
    public int insertPassCardRuleOperationLog(PassCardRuleOperationLog passCardRuleOperationLog)
    {
        passCardRuleOperationLog.setCreateTime(DateUtils.getNowDate());
        return passCardRuleOperationLogMapper.insertPassCardRuleOperationLog(passCardRuleOperationLog);
    }

    /**
     * 修改商品次卡规则操作记录
     *
     * @param passCardRuleOperationLog 商品次卡规则操作记录
     * @return 结果
     */
    @Override
    public int updatePassCardRuleOperationLog(PassCardRuleOperationLog passCardRuleOperationLog)
    {
        return passCardRuleOperationLogMapper.updatePassCardRuleOperationLog(passCardRuleOperationLog);
    }

    /**
     * 通过id批量删除商品次卡规则操作记录信息
     *
     * @param ids 需要删除的商品次卡规则操作记录主键
     * @return 结果
     */
    @Override
    public int deletePassCardRuleOperationLogByIds(Long[] ids)
    {
        return passCardRuleOperationLogMapper.deletePassCardRuleOperationLogByIds(ids);
    }

    /**
     * 通过id删除商品次卡规则操作记录信息
     *
     * @param id 商品次卡规则操作记录主键
     * @return 结果
     */
    @Override
    public int deletePassCardRuleOperationLogById(Long id)
    {
        return passCardRuleOperationLogMapper.deletePassCardRuleOperationLogById(id);
    }
}
